package com.example.demo.controller;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author void
 * @date 2020/7/3 15:03
 * @desc
 */
@RestController
@RequestMapping("/file")
public class FileController {
    
    @GetMapping("/get")
    public void get() throws IOException {
        Resource resource = new ClassPathResource("1.txt");
        InputStream is = resource.getInputStream();
    }
}
